# 1.先查找 Lua 依赖
find_package(Lua 5.4 REQUIRED)

# 2.定义可执行文件
add_executable(work main.cc)

# 3. 添加work模块自身的头文件路径(公开，其他模块使用work也可以索引到)
target_include_directories(work PUBLIC
    ${PROJECT_SOURCE_DIR}/include
    ${LUA_INCLUDE_DIR}
)

# 4.复制脚本到构建目录
# file(COPY ../logic DESTINATION ${CMAKE_BINARY_DIR})

# 5. 含 work 下的各子目录（都会产生静态库）
add_subdirectory(utils) # 内部work_utils

# 6.子目录都生成为静态库并链接依赖
target_link_libraries(work PUBLIC
    work_utils
    utils
    ${ZMQ_LIB}
    ${LUA_LIBRARIES}
    pthread
)